{% extends 'base.html' %}

{% block content %}
    <div class="main_con clearfix">
        <div class="left_menu_con clearfix">
			<h3>用户中心</h3>
			<ul>
				<li><a href="/user/info/" >· 个人信息</a></li>
				<li><a href="/user/user_center_order&1/" class="active">· 全部订单</a></li>
				<li><a href="/user/site/">· 收货地址</a></li>
			</ul>
		</div>
        <div class="right_content clearfix">
				<h3 class="common_title2">全部订单</h3>
            {% for orderinfo in page %}
				<ul class="order_list_th w978 clearfix">
					<li class="col01">{{ orderinfo.odate }}</li>
					<li class="col02">订单号：{{ orderinfo.oid }}</li>
                    {% if orderinfo.oIsPay == 0 %}
					    <li class="col02 stress">未支付</li>
                    {% else %}
                        <li class="col02 stress">已支付</li>
                    {% endif %}
				</ul>


				<table class="order_list_table w980">
					<tbody>
						<tr>
							<td width="55%">
                                {% for item in orderinfo.orderdetailinfo_set.all %}
								<ul class="order_goods_list clearfix">					
									<li class="col01"><img src="/static/{{  item.goods.gpic }}"></li>
									<li class="col02">{{ item.goods.gtitle }}<em><span>{{ item.price }}</span>元/{{item.goods.gunit}}</em></li>
									<li class="col03">{{ item.count }}</li>
									<li class="col04"></li>
								</ul>
                                    {% endfor %}
							</td>
							<td width="15%">{{ orderinfo.ototal }}元</td>
                        {% if orderinfo.oIsPay == 0 %}
                            <td width="15%">待付款</td>
							<td width="15%"><a href="/order/pay_{{ orderinfo.oid }}/" class="oper_btn">去付款</a></td>

                        {% else %}
                            <td width="15%">已付款</td>
							<td width="15%"><a href="#" class="oper_btn">查看物流</a></td>
                        {% endif %}
						</tr>
					</tbody>
				</table>
				{% endfor %}

                <div class="pagenation">
                    {% if page.has_previous %}
                        <a href="/user/user_center_order&{{ page.previous_page_number }}/">上一页</a>
                    {% endif %}

                    {% for pindex in paginator.page_range %}
                        {%  if pindex == page.number %}
                            <a href="/user_center_order&{{ pindex }}/" class="active">{{ pindex }}</a>
                        {% else %}
                        <a href="/user/user_center_order&{{ pindex }}/">{{ pindex }}</a>
                        {% endif %}
                    {% endfor %}

                    {% if page.has_next %}
                        <a href="/user/user_center_order&{{ page.next_page_number }}/">下一页</a>
                    {% endif %}
                </div>

		</div>

    </div>
{% endblock content %}